#ifndef __LCG_H__
#define	__LCG_H__ 1

#include <stdint.h>

#include "prng.h"

class CLcg : public IPrng
{
public:
    /**
     * Linear congruential generator
     * @param pSeed starting value
     * @param pMultiplier
     * @param pIncrement
     * @param pModulo
     */
    CLcg(int16_t pSeed = sDefaultSeed,
            int16_t pMultiplier = sDefaultMultiplier,
            int16_t pIncrement = sDefaultIncrement,
            int16_t pModulo = sDefaultModulo)
            : mSeed(pSeed),
            mMultiplier(pMultiplier),
            mIncrement(pIncrement),
            mModulo(pModulo) { }
    virtual ~CLcg() { }

    /**
     * calculates random number
     */
    int16_t getRand();

private:
    const static int16_t sDefaultSeed = 1;
    const static int16_t sDefaultMultiplier = 7;
    const static int16_t sDefaultIncrement = 5;
    const static int16_t sDefaultModulo = 29;
    
    int16_t mSeed;
    int16_t mMultiplier;
    int16_t mIncrement;
    int16_t mModulo;
};

#endif	/* __LCG_H__ */
